0 CpxTRS
↳1 NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxTRS
↳3 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxWeightedTrs
↳5 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳6 CpxTypedWeightedTrs
↳7 CompletionProof (UPPER BOUND(ID), 0 ms)
↳8 CpxTypedWeightedCompleteTrs
↳9 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 8 ms)
↳10 CpxRNTS
↳11 CompleteCoflocoProof (⇔, 136 ms)
↳12 BOUNDS(1, n^1)
f(a) → b
f(c) → d
f(g(x, y)) → g(f(x), f(y))
f(h(x, y)) → g(h(y, f(x)), h(x, f(y)))
g(x, x) → h(e, x)
f(a) → b
f(c) → d
f(h(x, y)) → g(h(y, f(x)), h(x, f(y)))
g(x, x) → h(e, x)
f(a) → b [1]
f(c) → d [1]
f(h(x, y)) → g(h(y, f(x)), h(x, f(y))) [1]
g(x, x) → h(e, x) [1]
f(a) → b [1]
f(c) → d [1]
f(h(x, y)) → g(h(y, f(x)), h(x, f(y))) [1]
g(x, x) → h(e, x) [1]
f :: a:b:c:d:h:e → a:b:c:d:h:e a :: a:b:c:d:h:e b :: a:b:c:d:h:e c :: a:b:c:d:h:e d :: a:b:c:d:h:e h :: a:b:c:d:h:e → a:b:c:d:h:e → a:b:c:d:h:e g :: a:b:c:d:h:e → a:b:c:d:h:e → a:b:c:d:h:e e :: a:b:c:d:h:e |
f(v0) → null_f [0]
g(v0, v1) → null_g [0]
null_f, null_g
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
a => 0
b => 1
c => 2
d => 3
e => 4
null_f => 0
null_g => 0
f(z) -{ 1 }→ g(1 + y + f(x), 1 + x + f(y)) :|: z = 1 + x + y, x >= 0, y >= 0
f(z) -{ 1 }→ 3 :|: z = 2
f(z) -{ 1 }→ 1 :|: z = 0
f(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0
g(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
g(z, z') -{ 1 }→ 1 + 4 + x :|: z' = x, x >= 0, z = x
eq(start(V, V3),0,[f(V, Out)],[V >= 0]). eq(start(V, V3),0,[g(V, V3, Out)],[V >= 0,V3 >= 0]). eq(f(V, Out),1,[],[Out = 1,V = 0]). eq(f(V, Out),1,[],[Out = 3,V = 2]). eq(f(V, Out),1,[f(V2, Ret01),f(V1, Ret11),g(1 + V1 + Ret01, 1 + V2 + Ret11, Ret)],[Out = Ret,V = 1 + V1 + V2,V2 >= 0,V1 >= 0]). eq(g(V, V3, Out),1,[],[Out = 5 + V4,V3 = V4,V4 >= 0,V = V4]). eq(f(V, Out),0,[],[Out = 0,V5 >= 0,V = V5]). eq(g(V, V3, Out),0,[],[Out = 0,V6 >= 0,V7 >= 0,V = V6,V3 = V7]). input_output_vars(f(V,Out),[V],[Out]). input_output_vars(g(V,V3,Out),[V,V3],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [g/3]
1. recursive [non_tail,multiple] : [f/2]
2. non_recursive : [start/2]
#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into g/3
1. SCC is partially evaluated into f/2
2. SCC is partially evaluated into start/2
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations g/3
* CE 8 is refined into CE [10]
* CE 9 is refined into CE [11]
### Cost equations --> "Loop" of g/3
* CEs [10] --> Loop 8
* CEs [11] --> Loop 9
### Ranking functions of CR g(V,V3,Out)
#### Partial ranking functions of CR g(V,V3,Out)
### Specialization of cost equations f/2
* CE 7 is refined into CE [12]
* CE 5 is refined into CE [13]
* CE 4 is refined into CE [14]
* CE 6 is refined into CE [15,16]
### Cost equations --> "Loop" of f/2
* CEs [16] --> Loop 10
* CEs [15] --> Loop 11
* CEs [12] --> Loop 12
* CEs [13] --> Loop 13
* CEs [14] --> Loop 14
### Ranking functions of CR f(V,Out)
* RF of phase [10,11]: [V]
#### Partial ranking functions of CR f(V,Out)
* Partial RF of phase [10,11]:
- RF of loop [10:1,10:2,11:1,11:2]:
V
### Specialization of cost equations start/2
* CE 2 is refined into CE [17,18,19]
* CE 3 is refined into CE [20,21]
### Cost equations --> "Loop" of start/2
* CEs [21] --> Loop 15
* CEs [17,18,19,20] --> Loop 16
### Ranking functions of CR start(V,V3)
#### Partial ranking functions of CR start(V,V3)
Computing Bounds
=====================================
#### Cost of chains of g(V,V3,Out):
* Chain [9]: 0
with precondition: [Out=0,V>=0,V3>=0]
* Chain [8]: 1
with precondition: [V=V3,V+5=Out,V>=0]
#### Cost of chains of f(V,Out):
* Chain [14]: 1
with precondition: [V=0,Out=1]
* Chain [13]: 1
with precondition: [V=2,Out=3]
* Chain [12]: 0
with precondition: [Out=0,V>=0]
* Chain [multiple([10,11],[[14],[13],[12]])]: 2*it(10)+1*it(11)+1*it([13])+1*it([14])+0
Such that:it([13]) =< V/3+1/3
aux(1) =< V+1
aux(2) =< 10/9*V+1/9
aux(3) =< 12/11*V+1/11
it([13]) =< aux(1)
it([14]) =< aux(1)
it(10) =< aux(2)
it(11) =< aux(2)
it([13]) =< aux(2)
it(11) =< aux(3)
it([13]) =< aux(3)
with precondition: [V>=1,Out>=0,7*V+7>=2*Out]
#### Cost of chains of start(V,V3):
* Chain [16]: 1*s(9)+1*s(12)+2*s(13)+1*s(14)+1
Such that:s(8) =< V+1
s(9) =< V/3+1/3
s(10) =< 10/9*V+1/9
s(11) =< 12/11*V+1/11
s(9) =< s(8)
s(12) =< s(8)
s(13) =< s(10)
s(14) =< s(10)
s(9) =< s(10)
s(14) =< s(11)
s(9) =< s(11)
with precondition: [V>=0]
* Chain [15]: 1
with precondition: [V=V3,V>=0]
Closed-form bounds of start(V,V3):
-------------------------------------
* Chain [16] with precondition: [V>=0]
- Upper bound: 14/3*V+8/3
- Complexity: n
* Chain [15] with precondition: [V=V3,V>=0]
- Upper bound: 1
- Complexity: constant
### Maximum cost of start(V,V3): 14/3*V+8/3
Asymptotic class: n
* Total analysis performed in 143 ms.